package com.bsj.sipgateway.web.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.bsj.power.common.config.global.JsonResult;
import com.bsj.power.common.def.dto.ClassificationDTO;
import com.bsj.power.common.def.vo.ClassificationSceneDevicesVO;
import com.bsj.sipgateway.web.service.ClassificationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

/**
 * @Description
 * @Author zhaoyang
 * @Date 2024/9/4 14:30
 */
@Slf4j
@RestController
@RequestMapping(value = "/classification")
//@SaCheckPermission(value = "VIDEO_MONITOR")
public class ClassificationController {

    @Autowired
    @Qualifier("classificationServiceImpl")
    private ClassificationService classificationService;

    @PostMapping("/add")
    public JsonResult add(@RequestBody ClassificationDTO classificationDTO) {
        return classificationService.add(classificationDTO);
    }

    @GetMapping("/getTree")
    public JsonResult getTree() {
        return classificationService.getTree();
    }

    /**
     * 获取分级+场景+设备数据
     *
     * @return
     */
    @GetMapping("/classificationSceneDevices")
    public JsonResult<ClassificationSceneDevicesVO> classificationSceneDevices() {
        return classificationService.classificationSceneDevices();
    }




}
